// this is a class for an AtariGo game (who captures the first stone wins)

package com.klangner.go.app.rules;

import com.klangner.go.model.IBoard;

public class AtariGoGame extends GoGame {

  public AtariGoGame() {}

  public AtariGoGame(int boardSize, Player blackPlayer, Player whitePlayer) {
    super(boardSize, blackPlayer, whitePlayer);
  }

  // this is specific for AtariGo: when the first caption occurs the game is over
  public boolean gameOver() {
  	
  	if(consecutivePasses > 0){
      if (turn == IBoard.WHITE_STONE)
        gameResult = GoConstants.WhiteWIN;
      else
        gameResult = GoConstants.BlackWIN;  
      
      return true;
  	}
  	else if(nrCapturedStones > 0){
      
    	if (turn == IBoard.WHITE_STONE)
        gameResult = GoConstants.BlackWIN;
      else
        gameResult = GoConstants.WhiteWIN;
    	
    	return true;
    }

  	return false;
  }

}